<template>
  <div>
    <li v-for="item in carList.list" :key="item.id">{{ item.brand }}</li>
  </div>
</template>

<script setup>
import { reactive } from 'vue';

let carList = reactive({
  list: []
})
//如果是服务器请求数据了，需要覆盖原来数据
const st = setTimeout(() => {
  //直接修改是否可以？不可以
  const resList = [
    { i: 1, brand: '奥迪', price: 100 },
    { i: 2, brand: '奔驰', price: 200 },
    { i: 3, brand: '宝马', price: 150 },
  ]
  //通过
  // carList = carList.push(...resList)
  console.log(carList);
  
  carList.list = resList
}, 2000)

</script>

<style scoped lang='scss'></style>
